1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to a memory system configuring a computer system, and more particularly to a hierarchical memory architecture represented by a cache memory.
2. Description of Related Art
A cache memory is used to utilize a memory in a computer system more efficiently, and is located between a central processing unit and a main memory. Also, a cache memory is smaller than a main memory and may be accessed more rapidly than a main memory.
A performance of a cache memory system is determined by a cache hit ratio, a data access time when a cache hit occurs, a penalty when a cache miss occurs, and the like.
For example, when a size of a cache memory increases, a lifetime of data and a cache hit ratio may increase. However, a data access time may also increase. Accordingly, the size of a cache memory should be optimized.
In a direct mapping cache, when data is stored in a cache, a single location where the data is stored is determined.
A cache using the direct mapping scheme may be embodied in a relatively simple circuit. Accordingly, in a direct mapping cache, a data access time when a cache hit occurs in the cache is short. However, a cache hit ratio of the cache is relatively low.
In a direct mapping cache, when a cache miss occurs and a previous data stored in a cache is evicted, a victim cache is used to improve a cache hit ratio. The victim cache stores the previous data in another cache of a same level for a short time.
However, when data, required to be stored in a same location of a cache, is repeatedly accessed over a short time, data to be recycled may be evicted from a victim cache due to a small size of the victim cache. Accordingly, a cache miss may occur. Thus, a configuration to extend a lifetime of data is needed to be developed as a method for efficient management. The method for efficient management divides data into data to be recycled and data not to be recycled, without an increase of the size of a cache memory.
Thus, an efficient cache memory system is required in a computer system.